import { StyleSheet, Text, View } from 'react-native';

export default function TextDemo() {
  return(
      <View style={styles.container}>
        <Text
            style={styles.txt}
            numberOfLines={2}
            ellipsizeMode="tail"//多余字会省略号
            selectable={true}//是否可选择文本
            selectionColor='#C0C0C0'//选中后颜色
            onPress={()=>{console.log('press')}}
            onLongPress={()=>{console.log('longPress')}}
            allowFontScaling={true}//跟随系统字体大小
        >
          1233
        </Text>
      </View>
  )
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
  txt: {
    fontSize: 40,
    fontWeight: 'bold',
    fontFamily:'xx',
    color: '#3025ff',
    //阴影搭配
    textShadowColor: '#A0A0A0',//阴影颜色
    textShadowOffset: { width: 2, height: 4, },//阴影范围
    textShadowRadius: 6,//阴影长度
    //划线搭配
    textDecorationStyle:'solid',
    textDecorationLine:'line-through'//下划线'underline'
  },
});
